<template id="temp">
  <div>
    <div class="top">
      <span
        ><nut-icon style="font-size: 20px" @click="back" name="left"></nut-icon
      ></span>
      <div class="box1"><h3>全部资讯</h3></div>
    </div>
    <div class="bottomone">
      <div class="box1" v-for="(v, i) in datas" :key="i">
        <div class="box1one" style="font-size: 26px; color: red">
          {{ v.index }}
        </div>
        <div class="box1two">
          <div class="box1twoOne">{{ v.title }}</div>
          <p>{{ v.from }}{{ v.date }}</p>
        </div>
        <div class="box1there">
          <img :src="v.imgSrc" alt="" />
        </div>
      </div>
    </div>
  </div>
</template>

<script lang='ts'>
// 获取公告
import { api } from "../../api/api";
import { reactive } from "vue";
export default {
  setup() {
    // 返回上一页
    function back() {
      history.go(-1);
    }
    const datas = reactive([]);
    api.trip.gener().then((res: any) => {
      Object.assign(datas, res.data);
      // console.log(res.data);
    });
    return {
      // 返回上一页
      back,
      // 公告数据
      // travelInfo,
      datas,
    };
  },
};
</script>
<style lang="scss" scoped>
.top {
  width: 100%;
  background: #1ba9ba;
  height: 50px;
  line-height: 50px;
  display: flex;
  color: white;
  position: fixed;
  top: 0;
  .box1 {
    flex: 1;
    text-align: center;
    color: white;
  }
}
.bottomone {
  width: 100%;
  margin-top: 13%;
  .box1 {
    border-bottom: 1px solid #ccc;
    width: 100%;
    // height: 250px;
    display: flex;
    margin-top: 1.5%;
    .box1one {
      width: 7%;
      text-align: center;
      // background: red;
    }
    .box1two {
      margin-left: 2%;
      line-height: 30px;
      .box1twoOne {
        display: -webkit-box;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 1;
        overflow: hidden;
      }
    }

    .box1there {
      margin-right: 2%;
      margin-left: 2%;
      img {
        width: 100px;
        height: 60px;
      }
    }
  }
}
</style>